When executing code in a virtual machine (VM) environment, a user application program can run on different platforms. In such VM computer environments, native resources are typically allocated using system calls. In many computer-based drawing programs, a new drawing resource (such as a brush or a pen) is produced each time a new drawing object is created. Often, it is easy for developers to neglect the effects on the processor speed of producing a large number of drawing resources in drawing programs.
Managing each drawing resource generates system calls across a VM/native boundary between the managed code portion and the native code portion. System calls across this VM/native boundary demand considerable processor effort due to the varied code translations that may be necessary for virtual machines to comply with different computer platforms and languages, as well as the considerable amount of data that precisely describes each drawing resource. The garbage collection associated with removing the large number of drawing resources is considerable since each drawing resource has to be consciously removed individually, or alternately the drawing resources are removed after some prescribed period. If the drawing resources are removed after some period, then there may be a considerable number of drawing resources waiting for their duration to be removed. Storing such a considerable number of drawing resources may make such tasks as drawing programs slow in drawing programs. Additionally, present computer drawing programs typically produce multiple concurrently-saved copies of the drawing resource. For example, as the drawing resource is transferred between the VM, the native OS, and the OS itself, a copy of each drawing object is stored in memory associated with each location.
Drawing programs that run on such computer environments as stand alone computers, networked computer environments, and computer devices typically inefficiently manage such drawing resources, but such inefficiency is typically ignored due to the large processing abilities of these computer environments. Smaller and less powerful, memory constrained and processor constrained devices (i.e. resource constrained devices) such as PDA's, cellular telephones, computer devices, embedded devices, microprocessor devices, and microcomputer devices are becoming increasingly popular. Resource constrained devices rely on more limited software and operating systems than those applied to full size computers. Applying a large number of system calls to resource constrained devices commonly makes the system prohibitively slow to perform many drawing functions. The code transitions necessary for system calls in resource constrained devices that have been produced between the native code portion and the managed code portion in virtual machines (especially for demanding programs as drawing programs) are so processor intensive that the processor and memory resources become highly strained.
It would therefore be beneficial to improve the management of drawing resources within computer environments.